<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>平闰年判定</title>
		
		<script type="text/javascript">
			window.onload=function(){
			var judment=document.getElementById("judment");
			judment.onclick=function(){
				var years=document.getElementById("year").value;
				if(years%100!=0&&years%4==0||years%400==0)
				{document.getElementById("jud").innerText="闰年";}
				else{document.getElementById("jud").innerText="平年";//bug在values，正确的是value。但事实上不必如此，已修改!
				}	
			}}
		</script>
	</head>
	<body>
		<label for="year">请输入你要判断的年份：</label>
		<input type="text" name="" id="year" value="" />
		<input type="button" name="" id="judment" value="判断" /><br/>
		<label>判断结果：</label>
		<span id="jud">
			
		</span>
	</body>
</html>
<!-- <!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>平闰年判定</title>
		
		<script type="text/javascript">
			window.onload=function(){
			var judment=document.getElementById("judment");
			judment.onclick=function(){
				var years=document.getElementById("year").value;
				if(years%100!=0&&years%4==0||years%400==0)
				{document.getElementById("jud").value="闰年";}
				else{document.getElementById("jud").value="平年";
				}
			}}
		</script>
	</head>
	<body>
		<label for="year">请输入你要判断的年份：</label>
		<input type="text" name="" id="year" value="" />
		<input type="button" name="" id="judment" value="判断" /><br/>
		<label>判断结果：</label>
		<input type="text" name="" id="jud" value="" />
	</body>
</html>
 -->